import request from '@/utils/request'

// 查询项目信息列表
export function listProject(query) {
    return request({
        url: '/system/project/list',
        method: 'get',
        params: query
    })
}

// 查询项目信息详细
export function getProject(id) {
    return request({
        url: '/system/project/' + id,
        method: 'get'
    })
}

// 新增项目信息
export function addProject(data) {
    return request({
        url: '/system/project',
        method: 'post',
        data: data
    })
}

// 修改项目信息
export function updateProject(data) {
    return request({
        url: '/system/project',
        method: 'put',
        data: data
    })
}

// 删除项目信息
export function delProject(id) {
    return request({
        url: '/system/project/' + id,
        method: 'delete'
    })
}

/**
 * 项目密钥生成
 * @param data
 * @returns {*}
 */
export function posthandleGenerate(data) {

    return request({
        url: `system/project/generaLicense/${data.id}/${data.endTime}/${data.license}`,
        method: 'GET',
        responseType: 'blob',

    })
}

/**
 * 项目密钥下载
 * @param data
 * @returns {*}
 */

export function posthandleDownload(data) {

    return request({
        url: '/system/project',
        method: 'put',
        data: data
    })
}

/**
 *  获取机器码
 */

export function getbioscode() {
    return request({
        url: '/cipher/getBiosUuid',
        method: 'GET',
    })
}

